<h1>Listing purchases</h1>

<table>
  <tr>
    <th>Receipt</th>
    <th>Item</th>
    <th>Quantity</th>
    <th>Price</th>
    <th>Taxrate</th>
    <th>Sale</th>
    <th>Coupon</th>
    <th>Text</th>
  </tr>

<% for purchase in @purchases %>
  <tr>
    <td><%=h purchase.receipt.store.company.name %></td>
    <td><%=h purchase.item.name %></td>
    <td><%=h purchase.quantity %></td>
    <td><%=h purchase.price %></td>
    <td><%=h purchase.tax_rate %></td>
    <td><%=h purchase.sale %></td>
    <td><%=h purchase.coupon %></td>
    <td><%=h purchase.notes %></td>
    <td><%= link_to image_tag("view.gif"), purchase %></td>
    <td><%= link_to image_tag("edit.gif"), edit_purchase_path(purchase) %></td>
    <td><%= link_to image_tag("delete.gif"), purchase, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New purchase', new_purchase_path %>
